package com.mis.clothespos.holdOrder.service.impl;

import com.mis.clothespos.holdOrder.domain.HoldOrder;
import com.mis.clothespos.holdOrder.domain.HoldOrdertoItem;
import com.mis.clothespos.holdOrder.domain.Holdorderitem;
import com.mis.clothespos.holdOrder.mapper.HoldOrderMapper;
import com.mis.clothespos.holdOrder.mapper.HoldOrdertoItemMapper;
import com.mis.clothespos.holdOrder.mapper.HoldorderitemMapper;
import com.mis.clothespos.holdOrder.service.HoldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Primary
public class HoldServiceImpl implements HoldService {

    @Autowired
    HoldOrderMapper holdOrderMapper;
    @Autowired
    HoldorderitemMapper holdorderitemMapper;
    @Autowired
    HoldOrdertoItemMapper holdOrdertoItemMapper;

    @Override
    public int deleteByPrimaryKey(String id) {
        return holdOrderMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(HoldOrder record) {
        return holdOrderMapper.insertSelective(record);
    }

    @Override
    public int insertSelective(HoldOrder record) {
        return holdOrderMapper.insert(record);
    }

    @Override
    public List<HoldOrder> select() {
        return holdOrderMapper.select();
    }

    @Override
    public List<HoldOrder> selectByPhone(HoldOrder order) {
        return holdOrderMapper.selectByPhone(order);
    }

    @Override
    public int updateByPrimaryKeySelective(HoldOrder record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(HoldOrder record) {
        return 0;
    }

    @Override
    public int inserHoldOrderitem(Holdorderitem holdorderitem) {
        return holdorderitemMapper.insert(holdorderitem);
    }

    @Override
    public int insertHoldOrderToItem(HoldOrdertoItem holdOrdertoItem) {
        return holdOrdertoItemMapper.insert(holdOrdertoItem);
    }

    @Override
    public List<Holdorderitem> selectItemById(String orderid) {
        return holdorderitemMapper.selectItemById(orderid);
    }
}
